<?
if (!CModule::IncludeModule("consult"))
	return;

$arParams["stream_id"] = intval ($_GET["stream_id"]);

if ($arParams["stream_id"] <= 0)
	$arResult["ERRORS"][] = "Stream not set";

if (count ($arResult["ERRORS"]) <= 0)
{
	$ob_stream = new CConsultStream;
	$dbstream = $ob_stream->GetList (array(), array("ID"=> $arParams["stream_id"]), "Y"); 
	if ($dbstream && $arStream = $dbstream->Fetch())
	{
		$consUser = new CConsultUser;
		$arParams["AUTHOR"] = $consUser::GetByID($arStream["OWNER_ID"]);
		$arResult["CUR_USER"] = CConsultUser::GetCurConsultUser(true);
	}
	else
	{
		$arResult["ERRORS"][] = "ACCESS DENIED";
	}
}

$dirPath = '/bitrix/components/custom/consult.mess.list';
$arResult["MsgAddPath"] = $dirPath."/add_message.php";
$arResult["MsgGetPath"] = $dirPath."/get_message.php";
$arResult["NOW"] = date("Y-m-d H:i:s");

$this->IncludeComponentTemplate();
?>